import { reactive } from "vue";
import {
  IFormModuleType,
  IFormConfigType
} from "@/components/form-module/type/type";
import { IShowTableConfigType } from "@/components/show-table/type/type";
export const queryFormItems: IFormModuleType[] = [
  {
    param: "createAt",
    label: "创建时间",
    type: "datePicker",
    colLayout: {
      xl: 12,
      lg: 12,
      md: 16,
      sm: 24,
      xs: 24
    },
    datePickerProp: {
      type: "daterange",
      rangeSeparator: "至",
      startPlaceholder: "开始时间",
      endPlaceholder: "结束时间"
    }
  },
  {
    param: "name",
    label: "角色名称",
    placeholder: "请输入角色名称",
    type: "input"
  }
];

export const roleListTableConfig: IShowTableConfigType[] = [
  {
    prop: "name",
    label: "角色名称"
  },
  {
    prop: "intro",
    label: "角色描述"
  },
  {
    prop: "createAt",
    label: "创建时间"
  },
  {
    prop: "updateAt",
    label: "更新时间"
  },
  {
    prop: "handle",
    label: "操作"
  }
];

export const dialogFormItems: IFormModuleType[] = [
  {
    param: "name",
    label: "角色名称",
    type: "input",
    placeholder: "请输入角色名称",
    colLayout: {
      span: 24
    }
  },
  {
    param: "intro",
    label: "角色描述",
    type: "input",
    placeholder: "请输入角色描述",
    colLayout: {
      span: 24
    }
  }
];

export const dialogFormConfig: IFormConfigType = reactive({
  rules: {
    name: [{ required: true, message: "角色名称不能为空", trigger: "blur" }],
    intro: [{ required: true, message: "角色描述不能为空", trigger: "blur" }]
  }
});
